//
//  MyGradeJYGCSectionHeaderView.m
//  我的等级
//
//  Created by 田涛 on 2017/9/29.
//  Copyright © 2017年 Lemon. All rights reserved.
//

#import "MyGradeJYGCSectionHeaderView.h"
#import "GlobalHeader.h"

@interface MyGradeJYGCSectionHeaderView ()
/** 标题*/
@property (nonatomic, strong)  UILabel *titleLbl;
@end

@implementation MyGradeJYGCSectionHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setup];
        [self layout];
    }
    return self;
}


/**
 *  初始化
 */
- (void)setup {
    self.backgroundColor = [UIColor colorWithRed:(239/255.0) green:(239/255.0) blue:(239/255.0) alpha:1];
    [self addSubview:self.titleLbl];
}


/**
 *  布局
 */
- (void)layout {
    _titleLbl.sd_layout
    .centerYEqualToView(self)
    .leftSpaceToView(self, WidthScale_IOS7(15))
    .heightRatioToView(self, 1);
    [_titleLbl setSingleLineAutoResizeWithMaxWidth:SCREEN_WIDTH/2];
}

#pragma mark - 懒加载
- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.backgroundColor = [UIColor clearColor];
        _titleLbl.text = @"经验构成";
        _titleLbl.font = [UIFont systemFontOfSize:WidthScale_IOS7(16)];
    }
    return _titleLbl;
}
@end
